package com.sxf.biz.ocr.controller;

import com.sxf.biz.ocr.service.OcrService;
import com.sxf.biz.subjects.vo.BankOcrRes;
import com.sxf.common.param.ResultInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @description: TODO
 * @Author Leo
 * @date 2024/3/2721:33
 */
@RestController
@Api(value = "OCR相关", tags = { "OCR相关" })
@Validated
@RequestMapping("/ocr")
public class OcrController {

    @Autowired
    OcrService ocrService;

    @PostMapping("/bankCard")
    @ApiOperation(value = "上传银行卡OCR识别",  produces = "multipart/form-data", httpMethod = "POST")
    public ResultInfo<BankOcrRes> bankCardOcr(@RequestParam MultipartFile file){
        return ResultInfo.success(ocrService.bankCardOcr(file));
    }

}
